import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { EnterpriseAddComponent } from './add/add';
import { EnterpriseEditComponent } from './edit/edit';
import { EnterpriseListComponent } from './list/list';

const routes: Routes = [
	{
		path: '',
		children: [
			{
				path: '',
				redirectTo: 'list',
			},
			{
				path: 'list',
				component: EnterpriseListComponent,
				data: {
					title: '企业管理',
					url: 'enterprise/list',
				},
			},
			{
				path: 'add',
				component: EnterpriseAddComponent,
				data: {
					title: '企业新增',
					url: 'enterprise/add',
				},
			},
			{
				path: 'edit',
				component: EnterpriseEditComponent,
				data: {
					title: '企业修改',
					url: 'enterprise/edit',
				},
			},
		],
	},
];

@NgModule({
	imports: [RouterModule.forChild(routes)],
	exports: [RouterModule],
})
export class EnterpriseRoutingModule {}
